import request from '@/utils/request'
import config from '@/utils/config'

// 分页查询房间商品信息
export function getRoomList(params) {
  return request({
    url: config.BaseUrl + '/room/query/page',
    method: 'get',
    params
  })
}

// 新增房间商品
export function addRoom(params) {
  return request({
    url: config.BaseUrl + '/room/add',
    method: 'post',
    data: params
  })
}

// 查询酒店商品详情
export function checkRoomInfo(params) {
  return request({
    url: config.BaseUrl + '/room/query/info',
    method: 'get',
    params
  })
}

// 编辑酒店商品信息
export function editRoom(params) {
  return request({
    url: config.BaseUrl + '/room/edit/all',
    method: 'post',
    data: params
  })
}

// 编辑商品上架/下架状态
export function editStatusRoom(params) {
  return request({
    url: config.BaseUrl + '/room/edit/saleStatus',
    method: 'post',
    data: params
  })
}

// 删除房间商品信息
export function delRoom(params) {
  return request({
    url: config.BaseUrl + '/room/del',
    method: 'post',
    data: params
  })
}

// ----------------  房型  ---------------------
// ----------------  房型  ---------------------
// ----------------  房型  ---------------------

// 分页查询房型类型数据
export function getRoomListType(params) {
  return request({
    url: config.BaseUrl + '/room/type/query/page',
    method: 'get',
    params
  })
}

// 新增房型类型
export function addRoomType(params) {
  return request({
    url: config.BaseUrl + '/room/type/add',
    method: 'post',
    data: params
  })
}

// 编辑房型类型信息
export function editRoomType(params) {
  return request({
    url: config.BaseUrl + '/room/type/edit/all',
    method: 'post',
    data: params
  })
}

// 删除房型类型信息  /room/type/del
export function delRoomType(params) {
  return request({
    url: config.BaseUrl + '/room/type/del',
    method: 'post',
    data: params
  })
}

// 房间类型——启用/停用状态编辑
export function editStatusRoomType(params) {
  return request({
    url: config.BaseUrl + '/room/type/edit/status',
    method: 'post',
    data: params
  })
}

// 酒店订单

// 分页查询酒店订单列表
export function getRoomOrderList(params) {
  return request({
    url: config.BaseUrl + '/room/order/query/page',
    method: 'get',
    params
  })
}

// 查询酒店订单详情
export function getRoomInfo(params) {
  return request({
    url: config.BaseUrl + '/room/order/query/info',
    method: 'get',
    params
  })
}

// 确认有房操作
export function confirmRoom(params) {
  return request({
    url: config.BaseUrl + '/room/order/confirm',
    method: 'post',
    data: params
  })
}

// (酒店)手动取消订单
export function cancelRoom(params) {
  return request({
    url: config.BaseUrl + '/room/order/cancel',
    method: 'post',
    data: params
  })
}

// 确认入住（菜单）  confirmCheckInMenu, confirmCheckIn, confirmUncheckIn, addRemark, getRemarkList
export function confirmCheckInMenu(params) {
  return request({
    url: config.BaseUrl + '/room/order/query/page/today',
    method: 'get',
    params
  })
}

// 确认入住
export function confirmCheckIn(params) {
  return request({
    url: config.BaseUrl + '/room/order/confirm/live',
    method: 'post',
    data: params
  })
}

// 确认未入住
export function confirmUncheckIn(params) {
  return request({
    url: config.BaseUrl + '/room/order/confirm/unlive',
    method: 'post',
    data: params
  })
}

// 新增订单备注
export function addRoomRemark(params) {
  return request({
    url: config.BaseUrl + '/room/order/add/remarks',
    method: 'post',
    data: params
  })
}

// 分页查询酒店订单备注记录
export function getRoomRemarkList(params) {
  return request({
    url: config.BaseUrl + '/room/order/query/remarks',
    method: 'get',
    params
  })
}

// 手动完成退款
export function handelRefund(params) {
  return request({
    url: config.BaseUrl + '/room/order/refund/finish',
    method: 'post',
    data: params
  })
}

// 同意退款
export function agreeRefund(params) {
  return request({
    url: config.BaseUrl + '/room/order/refund/agree',
    method: 'post',
    data: params
  })
}

// 拒绝退款操作
export function refuseRefund(params) {
  return request({
    url: config.BaseUrl + '/room/order/refund/refuse',
    method: 'post',
    data: params
  })
}
